﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dropthings.DataAccess
{
    public class ObjectBuilder
    {

        public static void BuildDefaultWidgetInstance(WidgetInstance wi, string title, int widgetZoneId, int position, int widgetId, string state)
        {
            wi.CreatedDate = DateTime.Now;
            wi.VersionNo = 1;
            wi.State = string.Empty;
            wi.Expanded = true;

            wi.Title = title;
            wi.WidgetZoneId = widgetZoneId;
            wi.WidgetId = widgetId;
            wi.OrderNo = position;
            wi.State = state;
        }

        public static void BuildDefaultPage(Page p, Guid userId, string title, int layoutType)
        {
            p.CreatedDate = DateTime.Now;
            p.ColumnCount = 3;
            p.VersionNo = 1;
            p.PageType = Enumerations.PageTypeEnum.PersonalPage;

            p.UserId = userId;
            p.Title = title;
            p.LayoutType = layoutType;
        }

        public static void BuildDefaultWidgetZone(WidgetZone zone, string title, string uniqueID, int orderNo)
        {
            zone.Title = title;
            zone.UniqueID = uniqueID;
            zone.OrderNo = orderNo;
        }
    }
}
